package com.itheima.object1;

import java.util.Scanner;
import java.util.concurrent.CountDownLatch;

public class SpringTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个字符串!");
        String s = sc.nextLine();
//        //遍历字符串
//        for (int i = 0; i < s.length(); i++) {
//            //第一种方式
//            char c = s.charAt(i);
//            System.out.println(c);
//        }
        //第二种方式
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }
    }
    }

